Skip to content

Commit 399c07d

Browse files
Arnaldo Carvalho de MeloDavid S. Miller
Arnaldo Carvalho de Melo
authored and
David S. Miller
committed
[IPV6]: Export ipv6_opt_accepted
It was already non-TCP specific, will be used by DCCPv6. Signed-off-by: Arnaldo Carvalho de Melo <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent f21e68c commit 399c07d

File tree

3 files changed

+23
-16
lines changed

3 files changed

+23
-16
lines changed

include/net/ipv6.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,8 @@ extern struct ipv6_txoptions * ipv6_renew_options(struct sock *sk, struct ipv6_t
240240
struct ipv6_txoptions *ipv6_fixup_options(struct ipv6_txoptions *opt_space,
241241
struct ipv6_txoptions *opt);
242242

243+
extern int ipv6_opt_accepted(struct sock *sk, struct sk_buff *skb);
244+
243245
extern int ip6_frag_nqueues;
244246
extern atomic_t ip6_frag_mem;
245247

net/ipv6/af_inet6.c

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -663,6 +663,27 @@ int inet6_sk_rebuild_header(struct sock *sk)
663663

664664
EXPORT_SYMBOL_GPL(inet6_sk_rebuild_header);
665665

666+
int ipv6_opt_accepted(struct sock *sk, struct sk_buff *skb)
667+
{
668+
struct ipv6_pinfo *np = inet6_sk(sk);
669+
struct inet6_skb_parm *opt = IP6CB(skb);
670+
671+
if (np->rxopt.all) {
672+
if ((opt->hop && (np->rxopt.bits.hopopts ||
673+
np->rxopt.bits.ohopopts)) ||
674+
((IPV6_FLOWINFO_MASK & *(u32*)skb->nh.raw) &&
675+
np->rxopt.bits.rxflow) ||
676+
(opt->srcrt && (np->rxopt.bits.srcrt ||
677+
np->rxopt.bits.osrcrt)) ||
678+
((opt->dst1 || opt->dst0) &&
679+
(np->rxopt.bits.dstopts || np->rxopt.bits.odstopts)))
680+
return 1;
681+
}
682+
return 0;
683+
}
684+
685+
EXPORT_SYMBOL_GPL(ipv6_opt_accepted);
686+
666687
int
667688
snmp6_mib_init(void *ptr[2], size_t mibsize, size_t mibalign)
668689
{

net/ipv6/tcp_ipv6.c

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -711,22 +711,6 @@ static struct request_sock_ops tcp6_request_sock_ops = {
711711
.send_reset = tcp_v6_send_reset
712712
};
713713

714-
static int ipv6_opt_accepted(struct sock *sk, struct sk_buff *skb)
715-
{
716-
struct ipv6_pinfo *np = inet6_sk(sk);
717-
struct inet6_skb_parm *opt = IP6CB(skb);
718-
719-
if (np->rxopt.all) {
720-
if ((opt->hop && (np->rxopt.bits.hopopts || np->rxopt.bits.ohopopts)) ||
721-
((IPV6_FLOWINFO_MASK & *(u32*)skb->nh.raw) && np->rxopt.bits.rxflow) ||
722-
(opt->srcrt && (np->rxopt.bits.srcrt || np->rxopt.bits.osrcrt)) ||
723-
((opt->dst1 || opt->dst0) && (np->rxopt.bits.dstopts || np->rxopt.bits.odstopts)))
724-
return 1;
725-
}
726-
return 0;
727-
}
728-
729-
730714
static void tcp_v6_send_check(struct sock *sk, int len, struct sk_buff *skb)
731715
{
732716
struct ipv6_pinfo *np = inet6_sk(sk);

0 commit comments

Comments
 (0)