Module Name: src
Committed By: knakahara
Date: Thu Aug 18 11:38:58 UTC 2016
Modified Files:
src/sys/net: if_stf.c if_stf.h
Log Message:
eliminate stf(4)'s dependency on gif(4).
stf(4) depends on not gif(4) but ip_encap.
To generate a diff of this commit:
cvs rdiff -u -r1.98 -r1.99 src/sys/net/if_stf.c
cvs rdiff -u -r1.6 -r1.7 src/sys/net/if_stf.h
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/net/if_stf.c
diff -u src/sys/net/if_stf.c:1.98 src/sys/net/if_stf.c:1.99
--- src/sys/net/if_stf.c:1.98 Sun Aug 7 17:38:34 2016
+++ src/sys/net/if_stf.c Thu Aug 18 11:38:58 2016
@@ -1,4 +1,4 @@
-/* $NetBSD: if_stf.c,v 1.98 2016/08/07 17:38:34 christos Exp $ */
+/* $NetBSD: if_stf.c,v 1.99 2016/08/18 11:38:58 knakahara Exp $ */
/* $KAME: if_stf.c,v 1.62 2001/06/07 22:32:16 itojun Exp $ */
/*
@@ -75,12 +75,11 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_stf.c,v 1.98 2016/08/07 17:38:34 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_stf.c,v 1.99 2016/08/18 11:38:58 knakahara Exp $");
#ifdef _KERNEL_OPT
#include "opt_inet.h"
#include "stf.h"
-#include "gif.h" /*XXX*/
#endif
#ifndef INET6
@@ -116,7 +115,6 @@ __KERNEL_RCSID(0, "$NetBSD: if_stf.c,v 1
#include <netinet/ip6.h>
#include <netinet6/ip6_var.h>
-#include <netinet6/in6_gif.h>
#include <netinet6/in6_var.h>
#include <netinet/ip_ecn.h>
@@ -126,10 +124,6 @@ __KERNEL_RCSID(0, "$NetBSD: if_stf.c,v 1
#include <net/bpf.h>
-#if NGIF > 0
-#include <net/if_gif.h>
-#endif
-
#include "ioconf.h"
#define IN6_IS_ADDR_6TO4(x) (ntohs((x)->s6_addr16[0]) == 0x2002)
@@ -150,11 +144,7 @@ static int stf_clone_destroy(struct ifne
struct if_clone stf_cloner =
IF_CLONE_INITIALIZER("stf", stf_clone_create, stf_clone_destroy);
-#if NGIF > 0
-extern int ip_gif_ttl; /*XXX*/
-#else
-static int ip_gif_ttl = 40; /*XXX*/
-#endif
+static int ip_stf_ttl = STF_TTL;
extern struct domain inetdomain;
@@ -440,7 +430,7 @@ stf_output(struct ifnet *ifp, struct mbu
&ip->ip_src, sizeof(ip->ip_src));
memcpy(&ip->ip_dst, in4, sizeof(ip->ip_dst));
ip->ip_p = IPPROTO_IPV6;
- ip->ip_ttl = ip_gif_ttl; /*XXX*/
+ ip->ip_ttl = ip_stf_ttl;
ip->ip_len = htons(m->m_pkthdr.len);
if (ifp->if_flags & IFF_LINK1)
ip_ecn_ingress(ECN_ALLOWED, &ip->ip_tos, &tos);
Index: src/sys/net/if_stf.h
diff -u src/sys/net/if_stf.h:1.6 src/sys/net/if_stf.h:1.7
--- src/sys/net/if_stf.h:1.6 Thu Jan 28 00:28:11 2016
+++ src/sys/net/if_stf.h Thu Aug 18 11:38:58 2016
@@ -1,4 +1,4 @@
-/* $NetBSD: if_stf.h,v 1.6 2016/01/28 00:28:11 knakahara Exp $ */
+/* $NetBSD: if_stf.h,v 1.7 2016/08/18 11:38:58 knakahara Exp $ */
/* $KAME: if_stf.h,v 1.3 2000/03/25 07:23:33 sumikawa Exp $ */
/*
@@ -33,6 +33,8 @@
#ifndef _NET_IF_STF_H_
#define _NET_IF_STF_H_
+#define STF_TTL 40
+
#define STF_MTU (1280) /* Default MTU */
#define STF_MTU_MIN (1280) /* Minimum MTU */
#define STF_MTU_MAX (8192) /* Maximum MTU */