net/ipv6/output_core.c
Source file repositories/reference/linux-study-clean/net/ipv6/output_core.c
File Facts
- System
- Linux kernel
- Corpus path
net/ipv6/output_core.c- Extension
.c- Size
- 3204 bytes
- Lines
- 133
- Domain
- Networking Core
- Bucket
- Sockets, Protocols, Packet Path, And Network Policy
- Inferred role
- Networking Core: exported/initcall integration point
- Status
- integration implementation candidate
Why This File Exists
Networking stack implementation surface: socket APIs, protocol dispatch, packet flow, routing, filtering, and network namespaces.
- Networking stack implementation surface: socket APIs, protocol dispatch, packet flow, routing, filtering, and network namespaces.
- Exports symbols or registers init work; inspect boot/module ordering and who consumes the exported contract.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/export.hnet/ip.hnet/ipv6.hnet/ip6_fib.hnet/addrconf.hnet/secure_seq.hlinux/netfilter.h
Detected Declarations
function __ipv6_select_identfunction ipv6_select_identfunction ipv6_select_identfunction ip6_find_1stfragoptfunction __ip6_local_outfunction ip6_local_outexport ipv6_select_identexport ip6_find_1stfragoptexport __ip6_local_outexport ip6_local_out
Annotated Snippet
switch (**nexthdr) {
case NEXTHDR_HOP:
break;
case NEXTHDR_ROUTING:
found_rhdr = 1;
break;
case NEXTHDR_DEST:
#if IS_ENABLED(CONFIG_IPV6_MIP6)
if (ipv6_find_tlv(skb, offset, IPV6_TLV_HAO) >= 0)
break;
#endif
if (found_rhdr)
return offset;
break;
default:
return offset;
}
if (offset + sizeof(struct ipv6_opt_hdr) > packet_len)
return -EINVAL;
exthdr = (struct ipv6_opt_hdr *)(skb_network_header(skb) +
offset);
offset += ipv6_optlen(exthdr);
if (offset > IPV6_MAXPLEN)
return -EINVAL;
*nexthdr = &exthdr->nexthdr;
}
return -EINVAL;
}
EXPORT_SYMBOL(ip6_find_1stfragopt);
int __ip6_local_out(struct net *net, struct sock *sk, struct sk_buff *skb)
{
ipv6_set_payload_len(ipv6_hdr(skb), skb->len - sizeof(struct ipv6hdr));
IP6CB(skb)->nhoff = offsetof(struct ipv6hdr, nexthdr);
/* if egress device is enslaved to an L3 master device pass the
* skb to its handler for processing
*/
skb = l3mdev_ip6_out(sk, skb);
if (unlikely(!skb))
return 0;
skb->protocol = htons(ETH_P_IPV6);
return nf_hook(NFPROTO_IPV6, NF_INET_LOCAL_OUT,
net, sk, skb, NULL, skb_dst_dev(skb),
dst_output);
}
EXPORT_SYMBOL_GPL(__ip6_local_out);
int ip6_local_out(struct net *net, struct sock *sk, struct sk_buff *skb)
{
int err;
err = __ip6_local_out(net, sk, skb);
if (likely(err == 1))
err = dst_output(net, sk, skb);
return err;
}
EXPORT_SYMBOL_GPL(ip6_local_out);
Annotation
- Immediate include surface: `linux/export.h`, `net/ip.h`, `net/ipv6.h`, `net/ip6_fib.h`, `net/addrconf.h`, `net/secure_seq.h`, `linux/netfilter.h`.
- Detected declarations: `function __ipv6_select_ident`, `function ipv6_select_ident`, `function ipv6_select_ident`, `function ip6_find_1stfragopt`, `function __ip6_local_out`, `function ip6_local_out`, `export ipv6_select_ident`, `export ip6_find_1stfragopt`, `export __ip6_local_out`, `export ip6_local_out`.
- Atlas domain: Networking Core / Sockets, Protocols, Packet Path, And Network Policy.
- Implementation status: integration implementation candidate.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.