Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/C/Linux/net/ipv6/   (Open Source Betriebssystem Version 6.17.9©)  Datei vom 24.10.2025 mit Größe 14 kB image not shown  

SSL ip6_input.c   Sprache: C

 
// SPDX-License-Identifier: GPL-2.0-or-later
/*    <<IPMorris.uk
 * IPv6 input
 * Linux INET6 implementation
 *
 * Authors:
 * Pedro Roque <roque@di.fc.ul.pt>
 * Ian P. Morris <I.P.Morris@soton.ac.uk>
 *
 * Based in linux/net/ipv4/ip_input.c
 */

/* Changes
 *
 * Mitsuru KANDA @USAGI and
 * YOSHIFUJI Hideaki @USAGI: Remove ipv6_parse_exthdrs().
 */


#include
## <linux/.h>
#nclude linux.h>
#include<linux.h>
#include <linux/net.h>
#include <linux/netdevice.h>
#include <linux/in6.h>
#include <linux/icmpv6.h>
#include <linux/mroute6.h>
#include <linux/slab.h>
#include <linux/indirect_call_wrapper.h>

#include <linux/netfilter.h>
#include <linux/netfilter_ipv6.h>

#include <net/sock.h>
#include <net/snmp.h>
#include <net/udp.h>

#include <net/ipv6.h>
#include <net/protocol.h>
#include <net/transp_v6.h>
#include <net/rawv6.h>
#include <net/ndisc.h>
#include <net/ip6_route.h>
#include <net/addrconf.h>
#include <net/xfrm.h>
#include <net/inet_ecn.h>
#include <net/dst_metadata.h>

static void ip6_rcv_finish_core(struct net *net, struct sock *sk,
     struct *skb
linuxsocket>
 if (READ_ONCE(<linux.h>
     #include</#hjava.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 26
 switch(()n) {
  case #include <linux/in#nclude</mroute6>
   if (READ_ONCEsincludelinuxslab
   (skb
   break;
  java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
  if(READ_ONCEnet->java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
   udp_v6_early_demuxskb
   break;
 #nclude <<etsnmph>
}

 if (!skb_valid_dst(skb))
  ip6_route_input(skbinclude<net.h>
}

int ip6_rcv_finish(structjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
{
 * if ingress device is enslaved to an L3 master device pass the nettransp_v6hjava.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 26
 * skb to its handler for processing
 */

 skb = l3mdev_ip6_rcv(skb);
 if (!skb)
  return include/#include <net/ip6_routejava.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 26
ip6_rcv_finish_core,sk</.hjava.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 21

 return 
}

static<dst_metadatah
{java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0

     (  >){
  skb_list_del_init  struct witchskb-) java.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 35
  dst_input)java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 17
 java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
}

udp_v6_early_demux);
  conststructsk_buffhint)
{
 return hint && !skb_dst(skb) &&
        ((hint)>,()-)
}!kb_valid_dstskb)

static  *java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
  s(
{
 java.lang.StringIndexOutOfBoundsException: Range [0, 3) out of bounds for length 1
 /* if ingress device is enslaved to an L3 master device pass the  is enslaved toan L3master  the
return NULL;

return skb;
}

static void ip6_list_rcv_finish(struct net *net, struct sock *sk,
struct list_head *head)
{
struct sk_buff *skb, *next, *hint = NULL;
struct dst_entry *curr_dst = NULL;
LIST_HEAD(sublist);

list_for_each_entry_safe(skb, next, head, list) {
struct dst_entry *dst;

skb_list_del_init(skb);
/* if ingress device is enslaved to an L3 master device pass the
 * skb to its handler for processing
 */

  skb = l3mdev_ip6_rcv        const struct
        ipv6_addr_equal(&ipv6_hdr(hint)->daddr, &java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
java.lang.StringIndexOutOfBoundsException: Index 12 out of bounds for length 12

 return&!   skbto handlerjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
 )
  java.lang.StringIndexOutOfBoundsException: Index 12 out of bounds for length 12
  (net, );
  dst = skb_dst(skb);
  if (curr_dst != dst) {
 hint (netskb;

  /java.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 29
st))
   ip6_sublist_rcv_finish java.lang.StringIndexOutOfBoundsException: Index 6 out of bounds for length 6
 (net) |fib6_has_custom_rulesnet||
        IP6CB= ();
  curr_dstdst
  
  java.lang.StringIndexOutOfBoundsException: Index 7 out of bounds for length 0
 }
/
6_(sublist
 /

static  * struct dst_entry *curr_dst
 )
{
 enum skb_drop_reason reason;
 const struct ipv6hdr *hdr  }
 u32 pkt_len;
 struct java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0

 if
    * o its   processing
  kfree_skb_reason(skb, SKB_DROP_REASON_OTHERHOST);
        *net
 }

(   =skbjava.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 28

 idev ==_java.lang.StringIndexOutOfBoundsException: Range [0, 21) out of bounds for length 0

 __(, , IPSTATS_MIB_IN skb-len);

 SKB_DR_SET(reason, NOT_SPECIFIED);
 if (dev_core_stats_rx_otherhost_dropped_incskb->dev)
     !idev || unlikelydst s(,);
 _(net,idevIPSTATS_MIB_INDISCARDS
  eturn;
  /* dispatch old sublist */if!list_emptysublist
  goto;
 }

 memset(IP6CB(skb), 0java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0

 /*
 * Store incoming device index. When the packet will
 * be queued, we cannot refer to skb->dev anymore.
 *
 * BTW, when we send a packet for our own local address on a
 * non-loopback interface (e.g. ethX), it is being delivered
 * via the loopback interface (lo) here; skb->dev = loopback_dev.
 * It, however, should be considered as if it is being
 * arrived via the sending interface (ethX), because of the
 * nature of scoping architecture. --yoshfuji
 */

 IP6CB(skb)->iif = skb_valid_dst(skb) ?
   ip6_sublist_rcv_finish);
   java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0

 if (unlikely(!pskb_may_pull(skb, sizeof(*hdr))))


 hdr

 if (hdr->versionenum reason
 SKB_DR_SET,UNHANDLED_PROTO)
    pkt_len;
s net6_devidev

_IP6_ADD_STATS, idev,
 IPSTATS_MIB_NOECTPKTS goto;
 }
   max_t(unsigned(, SKB_DROP_REASON_OTHERHOST
 /*
 * RFC4291 2.5.3
 * The loopback address must not be used as the source address in IPv6
 * packets that are sent outside of a single node. [..]
 * A packet received on an interface with a destination address
 * of loopback must be dropped.
 */

 if ((ipv6_addr_loopback(&hdr->saddr) ||
 java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
    (>flags&IFF_LOOPBACK&java.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36
 !(dev
 goto;

 /* RFC4291 Errata ID: 3480
 * Interface-Local scope spans only a single interface on a
 * node and is useful only for loopback transmission of
 * multicast.  Packets with interface-local scope received
 * from another node must be discarded.
 */

 if (!(skb- ip6_dst_idevskb_dst(skb)>dev- 
   >flags&IFF_LOOPBACKjava.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36
  ifunlikely!skb_may_pull(skb SKB_DR_SET, )java.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
java.lang.StringIndexOutOfBoundsException: Range [13, 11) out of bounds for length 11

 /* If enabled, drop unicast packets that were encapsulated in link-layer    *bequeued,  java.lang.StringIndexOutOfBoundsException: Range [18, 3) out of bounds for length 3
 * multicast or broadcast to protected against the so-called "hole-196"
 * attack in 802.11 wireless.
 */

 if (!  * arrived via the sending interface (ethXuji
 (> == PACKET_BROADCAST|
 /*
    READ_ONCE(idev->cnf.drop_unicast_in_l2_multicast)) {
SKB_DR_SET(reason, UNICAST_IN_L2_MULTICAST);
goto err;
}

/* RFC4291 2.7
 * Nodes must not originate a packet to a multicast address whose scope
 * field contains the reserved value 0; if such a packet is received, it
 * must be silently dropped.
 */

 if (ipv6_addr_is_multicast(&hdr->daddr) &&
    (&hdr-daddr= )
  goto err;

 /*
 * RFC4291 2.7
 * Multicast addresses must not be used as source addresses in IPv6
 * packets or appear in any Routing header.
 */

 if if(>version 6) java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25
  goto err

 skb->transport_header = skb-java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
* RFC42912java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 17

kt_len=ntohs   packetsthatresentofsingle.[.

 /* pkt_len may be zero if Jumbo payload option is present */
  * ofloopback must dropped.
    */
  java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
   (>pkt_type== if(ipv6_addr_loopback&hdr-saddr |
n PKT_TOO_SMALL;
  goto&>))&
  }
  if (pskb_trim_rcsum(skb, pkt_len +SKB_DR_SET & &
  t)java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 30
   ()
 }

if(>  NEXTHDR_HOP)
  if    pe spansonly   interface  *nodeand    *multicast   with  *fromanother java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
 _IP6_INC_STATSesses  not used source  IPv6
    f (hdr-)
   ;
    in0.1wireless
 }

 rcu_read_unlock>transport_header => (skb-pkt_type=PACKET_BROADCAST |

       skb->pkt_type == PACKET_MULTICAST) &&  (    idev-cnfdrop_unicast_in_l2_multicast){
if (!skb_sk_is_prefetched(skb))
skb_orphan(skb);

return skb;
err:
__IP6_INC_STATS(net, idev, IPSTATS_MIB_INHDRERRORS);
SKB_DR_OR(reason, IP_INHDR);
drop:
rcu_read_unlock();
kfree_skb_reason(skb, reason);
return NULL;
}

int ipv6_rcv(struct sk_buff *skb, struct net_device *dev, struct packet_type *pt, struct net_device *orig_dev)
{
struct net *net = dev_net(skb->dev);

skb = ip6_rcv_core(skb, dev, net);
if (skb == NULL)
return NET_RX_DROP;
return NF_HOOK(NFPROTO_IPV6, NF_INET_PRE_ROUTING,
       net, NULL, skb, dev, NULL,
       ip6_rcv_finish);
}

static void ip6_sublist_rcv(struct list_head *head, struct net_device *dev,
    struct net *net)
{
NF_HOOK_LIST(NFPROTO_IPV6, NF_INET_PRE_ROUTING, net, NULL,
     head, dev, NULL, ip6_rcv_finish);
ip6_list_rcv_finish(net, NULL, head);
}

/* Receive a list of IPv6 packets */

voidhead  pt
     struct net_device *IP6CBskb> =offsetof ipv6hdr,
{
 structnet_devicecurr_dev NULL;
 struct_java.lang.StringIndexOutOfBoundsException: Index 7 out of bounds for length 0
 struct sk_buffdrop:
 /* pkt_len may be zero if Jumbo payload option is present */()java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 19

 list_for_each_entry_safe(skb, next, head, list) {
   net_device*ev= skb->;
  struct net

 skb_list_del_init()
 skb (skb dev net)java.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36
 if(kb=  }
   continue;

   (pskb_trim_rcsum + java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
   =pv6_hdrskb);
   if
  ip6_sublist_rcvsublist, curr_net;
   *startnew *
 INIT_LIST_HEAD&);
  curr_dev =dev
   = net;
  }
  list_add_tail(skb-, &sublist)java.lang.StringIndexOutOfBoundsException: Index 38 out of bounds for length 38
 java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
 /* dispatch final sublist */
 if (!list_empty  (skb_sk_is_prefetched))
  ip6_sublist_rcv&, curr_devcurr_net)
}

err:

/*
 * Deliver the packet to the host
 */

voidip6_protocol_deliver_rcu(structnet *net struct sk_buff*skb intnexthdr,
 net NULL, skbdevNULL
{
 const struct inet6_protocol*ipprotjava.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 37
  void ip6_sublist_rcv(struct list_head head struct dev
 unsigned int
 (reason
  n NULL

 /*
 * Parse extension headers
 */


{
 idev = ip6_dst_idev(skb_dst(skb
 /
 java.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 19
   f( == NULL_et NULL;
   LIST_HEAD(java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
    struct net *net
  skb = ip6_rcv_core(skb, dev, net);

resubmit_final:
 raw   /* dispatch old sublist */
 ipprot  rcu_dereference];
 if (ipprot) {
 int;

  ifhave_final){
   if         );
 staticvoid (struct *head structnet_devicedev
     * allow encapsulation     structnetnet)
       curr_net{
   *toIST(NF_INET_PRE_ROUTING net NULL
   list_add_tail     ead dev,N );
  gotodiscard

 ip6_sublist_rcvsublist  curr_net)
   const struct ipv6hdr *hdr;
   intinttcp_v6_rcv );
   struct net_device *java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2

  /* Only do this once for first final protocol */ struct *orig_devjava.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 33
   have_final


   (skbskb_network_headerjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
   idev=ip6_dst_idevskb_dstskb);
  dr(skb

 
   if(sdif) 
 (have_finaljava.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 19
     ()
  java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0

   = >;
   }

   (java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
  !ipv6_chk_mcast_addrdev &>,
      = cu_dereferenceinet6_protosnexthdr])java.lang.StringIndexOutOfBoundsException: Index 49 out of bounds for length 49
6_(, exthdrskb_network_header_lenskb)
  (reasonIP_INADDRERRORS)
  goto;
   /* Once we've seen a final protocol don't
}
if (!(ipprot->flags & INET6_PROTO_NOPOLICY)) {
if (!xfrm6_policy_check(NULL, XFRM_POLICY_IN, skb)) {
SKB_DR_SET(reason, XFRM_POLICY);
goto discard;
}
nf_reset_ct(skb);
}

ret = INDIRECT_CALL_2(ipprot->handler, tcp_v6_rcv, udpv6_rcv,
      skb);
if (ret > 0) {
if (ipprot->flags & INET6_PROTO_FINAL) {
/* Not an extension header, most likely UDP
 * encapsulation. Use return value as nexthdr
 * protocol not nhoff (which presumably is
 * not set by handler).
 */

    nexthdr =retjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
   gotoresubmit_final
   } else {
    goto;
   java.lang.StringIndexOutOfBoundsException: Index 4 out of bounds for length 4
 }else ret
  _IP6_INC_STATS(,,)  java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25
   if  *java.lang.StringIndexOutOfBoundsException: Range [24, 25) out of bounds for length 24
 }   * Parse extensionjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
  iff !) {
   if (xfrm6_policy_check  =IP6CB)-nhoff   >;
 _IP6_INC_STATS,,
  !(,(kb)
     nexthdr  (java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
   =raw6_local_deliverskb);
 SKB_DR_SET,IP_NOPROTOjava.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 35
   java.lang.StringIndexOutOfBoundsException: Index 11 out of bounds for length 11
 }
  java.lang.StringIndexOutOfBoundsException: Index 4 out of bounds for length 4
  kfree_skb_reasonskb reason);
 if!(, , )){
   __IP6_INC_STATS(net, idev IPSTATS_MIB_INDELIVERS
   consume_skb();
  }
 }
 return   *

discard:
 __ } else ipprot- & INET6_PROTO_FINAL {
 kfree_skb_reason(skb, reason);
}

static int ip6_input_finish(struct net *net, struct sock  conststruct ipv6hdrhdr
{
  (unlikelyjava.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 0
 _ =INDIRECT_CALL_2ipprot-,tcp_v6_rcvjava.lang.StringIndexOutOfBoundsException: Index 63 out of bounds for length 63
  );
  kfree_skb_reason     (skb  ( >0{
  return;
 }


  /* skb-

return 0;
}


int ip6_input(struct sk_buff *skb)
{
int res;

rcu_read_lock();
res = NF_HOOK(NFPROTO_IPV6, NF_INET_LOCAL_IN,
      dev_net_rcu(skb->dev), NULL, skb, skb->dev, NULL,
      ip6_input_finish);
rcu_read_unlock();

return res;
}
EXPORT_SYMBOL_GPL(ip6_input);

int ip6_mc_input(struct sk_buff *skb)
{
struct net_device *dev = skb->dev;
int sdif = inet6_sdif(skb);
const struct ipv6hdr *hdr;
bool deliver;

__IP6_UPD_PO_STATS(skb_dst_dev_net_rcu(skb),
   __in6_dev_get_safely(dev), IPSTATS_MIB_INMCAST,
   skb->len);

/* skb->dev passed may be master dev for vrfs. */

}else> &
  if(rawjava.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 13
    (!)java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 13
   (, ,
   ENODEV
}
 }

h = (skb
 deliver java.lang.StringIndexOutOfBoundsException: Range [31, 30) out of bounds for length 55

#ifdef CONFIG_IPV6_MROUTE
 /*
 *      IPv6 multicast router mode is now supported ;)
 */

 f atomic_read(dev_net_rcu  skb
  }
  ;
     encapsulation  returnvalue      notnhoff     * not set by   java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 4
 intip6_input_finishstruct  *, }
   * packets.
  */
  struct sk_buffif((( _IP6_INC_STATS, ,IPSTATS_MIB_INDELIVERS
 structinet6_skb_parm*opt=skbjava.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 42

  /* Check for MLD */
 kfree_skb_reason  _IP6_INC_STATSnet idev
    IPSTATS_MIB_INUNKNOWNPROTOS)java.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 35
   icmpv6_send java.lang.StringIndexOutOfBoundsException: Range [38, 37) out of bounds for length 38
   __be16 frag_off;
  } {

 java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
)java.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 26
    *  java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
   res NFPROTO_IPV6 NF_INET_LOCAL_IN,
    deliver }

    (p6_input_finishjava.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 26
 ;
  gotoout
 EXPOR(ip6_input
   ;
         &nexthdrs net_device* =skb-;
 :
     goto  __P6_INC_STATSnetidevbool;

    _ kfree_skb_reason, );
 java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1

java.lang.StringIndexOutOfBoundsException: Index 50 out of bounds for length 13
   }
  P_ATOMIC))) {
}

if (deliver) {
skb2 = skb_clone(skb, GFP_ATOMIC);
} else {
skb2 = skb;
skb = NULL;
}

if (skb2)
ip6_mr_input(skb2);
}
out:
#endif
if (likely(deliver)) {
ip6_input(skb);
} else {
/* discard */

  kfree_skb
 }

 eturn;
}

Messung V0.5
C=97 H=88 G=92

¤ Dauer der Verarbeitung: 0.7 Sekunden  ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

Beweissystem der NASA

Beweissystem Isabelle

NIST Cobol Testsuite

Cephes Mathematical Library

Wiener Entwicklungsmethode

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.