|
|
2cd29a |
From b5d27a8197012ac2b1b52621be2cfe0b5fc2b47e Mon Sep 17 00:00:00 2001
|
|
|
2cd29a |
From: Guy Harris <guy@alum.mit.edu>
|
|
|
2cd29a |
Date: Tue, 19 Nov 2013 10:45:42 -0800
|
|
|
2cd29a |
Subject: [PATCH] Handle using cooked mode for DLT_NETLINK in activate_new().
|
|
|
2cd29a |
|
|
|
2cd29a |
That's how we handle it elsewhere; if that can be cleaned up, especially
|
|
|
2cd29a |
if we can avoid opening a raw socket in the cooked-mode case, that would
|
|
|
2cd29a |
be nice.
|
|
|
2cd29a |
|
|
|
2cd29a |
Note this in comments.
|
|
|
2cd29a |
|
|
|
2cd29a |
(cherry picked from eeb0348fe8d74800af37759618270fb8bed17443)
|
|
|
2cd29a |
|
|
|
2cd29a |
Conflicts:
|
|
|
2cd29a |
pcap-linux.c
|
|
|
2cd29a |
---
|
|
|
2cd29a |
pcap-linux.c | 10 ++++++++--
|
|
|
2cd29a |
1 file changed, 8 insertions(+), 2 deletions(-)
|
|
|
2cd29a |
|
|
|
2cd29a |
diff --git a/pcap-linux.c b/pcap-linux.c
|
|
|
2cd29a |
index e6343b0..a0e543c 100644
|
|
|
2cd29a |
--- a/pcap-linux.c
|
|
|
2cd29a |
+++ b/pcap-linux.c
|
|
|
2cd29a |
@@ -2941,7 +2941,9 @@ static void map_arphrd_to_dlt(pcap_t *handle, int arptype, int cooked_ok)
|
|
|
2cd29a |
/* Don't expect IP packet out of this interfaces... */
|
|
|
2cd29a |
handle->linktype = DLT_LINUX_IRDA;
|
|
|
2cd29a |
/* We need to save packet direction for IrDA decoding,
|
|
|
2cd29a |
- * so let's use "Linux-cooked" mode. Jean II */
|
|
|
2cd29a |
+ * so let's use "Linux-cooked" mode. Jean II
|
|
|
2cd29a |
+ *
|
|
|
2cd29a |
+ * XXX - this is handled in activate_new(). */
|
|
|
2cd29a |
//handlep->cooked = 1;
|
|
|
2cd29a |
break;
|
|
|
2cd29a |
|
|
|
2cd29a |
@@ -2982,8 +2984,11 @@ static void map_arphrd_to_dlt(pcap_t *handle, int arptype, int cooked_ok)
|
|
|
2cd29a |
* We need to use cooked mode, so that in sll_protocol we
|
|
|
2cd29a |
* pick up the netlink protocol type such as NETLINK_ROUTE,
|
|
|
2cd29a |
* NETLINK_GENERIC, NETLINK_FIB_LOOKUP, etc.
|
|
|
2cd29a |
+ *
|
|
|
2cd29a |
+ * XXX - this is now handled in activate_new()
|
|
|
2cd29a |
*/
|
|
|
2cd29a |
- handle->cooked = 1;
|
|
|
2cd29a |
+
|
|
|
2cd29a |
+ /* handlep->cooked = 1; */
|
|
|
2cd29a |
break;
|
|
|
2cd29a |
|
|
|
2cd29a |
default:
|
|
|
2cd29a |
@@ -3122,6 +3127,7 @@ activate_new(pcap_t *handle)
|
|
|
2cd29a |
handle->linktype == DLT_LINUX_SLL ||
|
|
|
2cd29a |
handle->linktype == DLT_LINUX_IRDA ||
|
|
|
2cd29a |
handle->linktype == DLT_LINUX_LAPD ||
|
|
|
2cd29a |
+ handle->linktype == DLT_NETLINK ||
|
|
|
2cd29a |
(handle->linktype == DLT_EN10MB &&
|
|
|
2cd29a |
(strncmp("isdn", device, 4) == 0 ||
|
|
|
2cd29a |
strncmp("isdY", device, 4) == 0))) {
|
|
|
2cd29a |
--
|
|
|
2cd29a |
2.4.3
|
|
|
2cd29a |
|