summaryrefslogtreecommitdiff
path: root/sys/net/if_gif.c
diff options
context:
space:
mode:
authorAlexander Bluhm <bluhm@cvs.openbsd.org>2017-05-18 10:56:46 +0000
committerAlexander Bluhm <bluhm@cvs.openbsd.org>2017-05-18 10:56:46 +0000
commit4a8bd7e3495639f1cdd88bd2504d058ad958c3f6 (patch)
treeb39cdbcb9324fedeec1e116509d5250f851ba1dc /sys/net/if_gif.c
parent76ea618a134d0540f915355c9835d9095ab1fde5 (diff)
The function name ip4_input() is confusing as it also handles IPv6
packets. This is the IP in IP protocol input function, so call it ipip_input(). Rename the existing ipip_input() to ipip_input_gif() as it is the input function used by the gif interface. Pass the address family to make it consistent with pr_input. Use __func__ in debug print and panic messages. Move all ipip prototypes to the ip_ipip.h header file. OK dhill@ mpi@
Diffstat (limited to 'sys/net/if_gif.c')
-rw-r--r--sys/net/if_gif.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/sys/net/if_gif.c b/sys/net/if_gif.c
index 400e4a1e0a2..446ccc9ccac 100644
--- a/sys/net/if_gif.c
+++ b/sys/net/if_gif.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_gif.c,v 1.95 2017/05/17 09:00:08 mpi Exp $ */
+/* $OpenBSD: if_gif.c,v 1.96 2017/05/18 10:56:45 bluhm Exp $ */
/* $KAME: if_gif.c,v 1.43 2001/02/20 08:51:07 itojun Exp $ */
/*
@@ -47,6 +47,7 @@
#include <netinet/ip.h>
#include <netinet/ip_ether.h>
#include <netinet/ip_var.h>
+#include <netinet/ip_ipip.h>
#include <netinet/ip_ipsp.h>
#ifdef INET6
@@ -750,12 +751,12 @@ in_gif_input(struct mbuf **mp, int *offp, int proto, int af)
gifp->if_ipackets++;
gifp->if_ibytes += m->m_pkthdr.len;
/* We have a configured GIF */
- return ipip_input(mp, offp, gifp, proto);
+ return ipip_input_gif(mp, offp, proto, af, gifp);
}
inject:
/* No GIF interface was configured */
- return ip4_input(mp, offp, proto, af);
+ return ipip_input(mp, offp, proto, af);
}
#ifdef INET6
@@ -875,11 +876,11 @@ int in6_gif_input(struct mbuf **mp, int *offp, int proto, int af)
m->m_pkthdr.ph_ifidx = gifp->if_index;
gifp->if_ipackets++;
gifp->if_ibytes += m->m_pkthdr.len;
- return ipip_input(mp, offp, gifp, proto);
+ return ipip_input_gif(mp, offp, proto, af, gifp);
}
inject:
/* No GIF tunnel configured */
- return ip4_input(mp, offp, proto, af);
+ return ipip_input(mp, offp, proto, af);
}
#endif /* INET6 */