@@ -655,11 +655,12 @@ get_if_type(pcap_t *handle, int sock_fd, struct nl80211_state *state,
655
655
return PCAP_ERROR ;
656
656
}
657
657
658
- genlmsg_put (msg , 0 , 0 , genl_family_get_id (state -> nl80211 ), 0 ,
658
+ genlmsg_put (msg , NL_AUTO_PORT , NL_AUTO_SEQ ,
659
+ genl_family_get_id (state -> nl80211 ), 0 ,
659
660
0 , NL80211_CMD_GET_INTERFACE , 0 );
660
661
NLA_PUT_U32 (msg , NL80211_ATTR_IFINDEX , ifindex );
661
662
662
- err = nl_send_auto_complete (state -> nl_sock , msg );
663
+ err = nl_send_auto (state -> nl_sock , msg );
663
664
if (err < 0 ) {
664
665
if (err == - NLE_FAILURE ) {
665
666
/*
@@ -677,7 +678,7 @@ get_if_type(pcap_t *handle, int sock_fd, struct nl80211_state *state,
677
678
* available.
678
679
*/
679
680
snprintf (handle -> errbuf , PCAP_ERRBUF_SIZE ,
680
- "%s: nl_send_auto_complete failed getting interface type: %s" ,
681
+ "%s: nl_send_auto failed getting interface type: %s" ,
681
682
device , nl_geterror (- err ));
682
683
nlmsg_free (msg );
683
684
return PCAP_ERROR ;
@@ -744,15 +745,16 @@ add_mon_if(pcap_t *handle, int sock_fd, struct nl80211_state *state,
744
745
return PCAP_ERROR ;
745
746
}
746
747
747
- genlmsg_put (msg , 0 , 0 , genl_family_get_id (state -> nl80211 ), 0 ,
748
+ genlmsg_put (msg , NL_AUTO_PORT , NL_AUTO_SEQ ,
749
+ genl_family_get_id (state -> nl80211 ), 0 ,
748
750
0 , NL80211_CMD_NEW_INTERFACE , 0 );
749
751
NLA_PUT_U32 (msg , NL80211_ATTR_IFINDEX , ifindex );
750
752
DIAG_OFF_NARROWING
751
753
NLA_PUT_STRING (msg , NL80211_ATTR_IFNAME , mondevice );
752
754
DIAG_ON_NARROWING
753
755
NLA_PUT_U32 (msg , NL80211_ATTR_IFTYPE , NL80211_IFTYPE_MONITOR );
754
756
755
- err = nl_send_auto_complete (state -> nl_sock , msg );
757
+ err = nl_send_auto (state -> nl_sock , msg );
756
758
if (err < 0 ) {
757
759
nlmsg_free (msg );
758
760
switch (err ) {
@@ -783,7 +785,7 @@ DIAG_ON_NARROWING
783
785
* error message from libnl.
784
786
*/
785
787
snprintf (handle -> errbuf , PCAP_ERRBUF_SIZE ,
786
- "%s: nl_send_auto_complete failed adding %s interface: %s" ,
788
+ "%s: nl_send_auto failed adding %s interface: %s" ,
787
789
device , mondevice , nl_geterror (- err ));
788
790
return PCAP_ERROR ;
789
791
}
@@ -872,14 +874,15 @@ del_mon_if(pcap_t *handle, int sock_fd, struct nl80211_state *state,
872
874
return PCAP_ERROR ;
873
875
}
874
876
875
- genlmsg_put (msg , 0 , 0 , genl_family_get_id (state -> nl80211 ), 0 ,
877
+ genlmsg_put (msg , NL_AUTO_PORT , NL_AUTO_SEQ ,
878
+ genl_family_get_id (state -> nl80211 ), 0 ,
876
879
0 , NL80211_CMD_DEL_INTERFACE , 0 );
877
880
NLA_PUT_U32 (msg , NL80211_ATTR_IFINDEX , ifindex );
878
881
879
- err = nl_send_auto_complete (state -> nl_sock , msg );
882
+ err = nl_send_auto (state -> nl_sock , msg );
880
883
if (err < 0 ) {
881
884
snprintf (handle -> errbuf , PCAP_ERRBUF_SIZE ,
882
- "%s: nl_send_auto_complete failed deleting %s interface: %s" ,
885
+ "%s: nl_send_auto failed deleting %s interface: %s" ,
883
886
device , mondevice , nl_geterror (- err ));
884
887
nlmsg_free (msg );
885
888
return PCAP_ERROR ;
0 commit comments