diff mbox

[ovs-dev,2/2] conntrack: Add formatting support for IGMP, DCCP, and UDPLITE.

Message ID 1490733829-95917-2-git-send-email-jarno@ovn.org
State Accepted
Delegated to: Joe Stringer
Headers show

Commit Message

Jarno Rajahalme March 28, 2017, 8:43 p.m. UTC
Print names for protocols that are supported by (Linux) conntrack
(DCCP, UDPLITE) and IGMP, which has been seen in logs.

Signed-off-by: Jarno Rajahalme <jarno@ovn.org>
---
 lib/ct-dpif.c |  3 +++
 lib/packets.h | 12 ++++++++++++
 2 files changed, 15 insertions(+)

Comments

Joe Stringer March 28, 2017, 10:17 p.m. UTC | #1
On 28 March 2017 at 13:43, Jarno Rajahalme <jarno@ovn.org> wrote:
> Print names for protocols that are supported by (Linux) conntrack
> (DCCP, UDPLITE) and IGMP, which has been seen in logs.
>
> Signed-off-by: Jarno Rajahalme <jarno@ovn.org>

Acked-by: Joe Stringer <joe@ovn.org>
Jarno Rajahalme March 29, 2017, 12:21 a.m. UTC | #2
> On Mar 28, 2017, at 3:17 PM, Joe Stringer <joe@ovn.org> wrote:
> 
> On 28 March 2017 at 13:43, Jarno Rajahalme <jarno@ovn.org> wrote:
>> Print names for protocols that are supported by (Linux) conntrack
>> (DCCP, UDPLITE) and IGMP, which has been seen in logs.
>> 
>> Signed-off-by: Jarno Rajahalme <jarno@ovn.org>
> 
> Acked-by: Joe Stringer <joe@ovn.org>

Thanks for the reviews, series pushed to master, branch-2.7, and branch-2.6.

  Jarno
diff mbox

Patch

diff --git a/lib/ct-dpif.c b/lib/ct-dpif.c
index 2cdecf6..8f0b4ed 100644
--- a/lib/ct-dpif.c
+++ b/lib/ct-dpif.c
@@ -202,6 +202,9 @@  ct_dpif_format_ipproto(struct ds *ds, uint16_t ipproto)
         : (ipproto == IPPROTO_TCP) ? "tcp"
         : (ipproto == IPPROTO_UDP) ? "udp"
         : (ipproto == IPPROTO_SCTP) ? "sctp"
+        : (ipproto == IPPROTO_UDPLITE) ? "udplite"
+        : (ipproto == IPPROTO_DCCP) ? "dccp"
+        : (ipproto == IPPROTO_IGMP) ? "igmp"
         : NULL;
 
     if (name) {
diff --git a/lib/packets.h b/lib/packets.h
index a5a483b..a4de7a5 100644
--- a/lib/packets.h
+++ b/lib/packets.h
@@ -591,6 +591,18 @@  char *ip_parse_cidr_len(const char *s, int *n, ovs_be32 *ip,
 #define IPPROTO_SCTP 132
 #endif
 
+#ifndef IPPROTO_DCCP
+#define IPPROTO_DCCP 33
+#endif
+
+#ifndef IPPROTO_IGMP
+#define IPPROTO_IGMP 2
+#endif
+
+#ifndef IPPROTO_UDPLITE
+#define IPPROTO_UDPLITE 136
+#endif
+
 /* TOS fields. */
 #define IP_ECN_NOT_ECT 0x0
 #define IP_ECN_ECT_1 0x01