diff options
author | Guy Harris <guy@alum.mit.edu> | 2013-11-19 10:45:42 -0800 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2013-11-19 10:45:42 -0800 |
commit | eeb0348fe8d74800af37759618270fb8bed17443 (patch) | |
tree | 47581c79df691d9b67cadac9d7d9b3fd8056d241 /pcap-linux.c | |
parent | 310e34cf617781519b9d23782f4c8c298ec1e2dc (diff) |
Handle using cooked mode for DLT_NETLINK in activate_new().
That's how we handle it elsewhere; if that can be cleaned up, especially
if we can avoid opening a raw socket in the cooked-mode case, that would
be nice.
Note this in comments.
Diffstat (limited to 'pcap-linux.c')
-rw-r--r-- | pcap-linux.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/pcap-linux.c b/pcap-linux.c index 82a3437c..6c0723ab 100644 --- a/pcap-linux.c +++ b/pcap-linux.c @@ -2940,7 +2940,9 @@ static void map_arphrd_to_dlt(pcap_t *handle, int arptype, int cooked_ok) /* Don't expect IP packet out of this interfaces... */ handle->linktype = DLT_LINUX_IRDA; /* We need to save packet direction for IrDA decoding, - * so let's use "Linux-cooked" mode. Jean II */ + * so let's use "Linux-cooked" mode. Jean II + * + * XXX - this is handled in activate_new(). */ //handlep->cooked = 1; break; @@ -2981,8 +2983,10 @@ static void map_arphrd_to_dlt(pcap_t *handle, int arptype, int cooked_ok) * We need to use cooked mode, so that in sll_protocol we * pick up the netlink protocol type such as NETLINK_ROUTE, * NETLINK_GENERIC, NETLINK_FIB_LOOKUP, etc. + * + * XXX - this is handled in activate_new(). */ - handlep->cooked = 1; + //handlep->cooked = 1; break; default: @@ -3121,6 +3125,7 @@ activate_new(pcap_t *handle) handle->linktype == DLT_LINUX_SLL || handle->linktype == DLT_LINUX_IRDA || handle->linktype == DLT_LINUX_LAPD || + handle->linktype == DLT_NETLINK || (handle->linktype == DLT_EN10MB && (strncmp("isdn", device, 4) == 0 || strncmp("isdY", device, 4) == 0))) { |