libpcap/libpcap-no-old-socket.patch
Dirk Mueller 06013bf785 Accepting request 390357 from home:elvigia:branches:Base:System
- libpcap-no-old-socket.patch: never fallback to the obsolete
  SOCK_PACKET (kernel < 2.2) interface, this still happens
  for example, when you update the kernel, run iftop and 
  the old kernel af_packet module wasn't loaded, program fails
  and the kernel prints "iftop uses obsolete (PF_INET,SOCK_PACKET)"

OBS-URL: https://build.opensuse.org/request/show/390357
OBS-URL: https://build.opensuse.org/package/show/Base:System/libpcap?expand=0&rev=50
2016-04-17 20:16:22 +00:00

26 lines
758 B
Diff

Index: libpcap-1.7.3/pcap-linux.c
===================================================================
--- libpcap-1.7.3.orig/pcap-linux.c
+++ libpcap-1.7.3/pcap-linux.c
@@ -1425,16 +1425,10 @@ pcap_activate_linux(pcap_t *handle)
}
}
else if (ret == 0) {
- /* Non-fatal error; try old way */
- if ((ret = activate_old(handle)) != 1) {
- /*
- * Both methods to open the packet socket failed.
- * Tidy up and report our failure (handle->errbuf
- * is expected to be set by the functions above).
- */
- status = ret;
- goto fail;
- }
+ snprintf(handle->errbuf, PCAP_ERRBUF_SIZE,
+ "af_packet module unavailable, missing a reboot to new kernel?");
+ status = PCAP_ERROR;
+ goto fail;
}
/*