Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:security\smack\smack_lsm.c Create Date:2022-07-28 19:23:49
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:smk_skb_to_addr_ipv6

Proto:static int smk_skb_to_addr_ipv6(struct sk_buff *skb, struct sockaddr_in6 *sip)

Type:int

Parameter:

TypeParameterName
struct sk_buff *skb
struct sockaddr_in6 *sip
3789  proto = -EINVAL
3797  Transport layer port # = 0
3799  offset = skb_network_offset(skb)
3800  ip6 = skb_header_pointer(skb, offset, size of _ipv6h , & _ipv6h)
3801  If (ip6 == NULL) Then Return -EINVAL
3803  IPv6 address = saddr
3805  nexthdr = nexthdr
3806  offset += size of _ipv6h
3807  offset = ipv6_skip_exthdr(skb, offset, & nexthdr, & frag_off)
3808  If offset < 0 Then Return -EINVAL
3811  proto = nexthdr
3813  Case proto == IPPROTO_TCP
3814  th = skb_header_pointer(skb, offset, size of _tcph , & _tcph)
3815  If (th != NULL) Then Transport layer port # = source
3817  Break
3818  Case proto == IPPROTO_UDP
3819  Case proto == IPPROTO_UDPLITE
3820  uh = skb_header_pointer(skb, offset, size of _udph , & _udph)
3821  If (uh != NULL) Then Transport layer port # = source
3823  Break
3824  Case proto == IPPROTO_DCCP
3825  dh = skb_header_pointer(skb, offset, size of _dccph , & _dccph)
3826  If (dh != NULL) Then Transport layer port # = dccph_sport
3828  Break
3830  Return proto
Caller
NameDescribe
smack_socket_sock_rcv_skbsmack_socket_sock_rcv_skb - Smack packet delivery access check*@sk: socket*@skb: packet* Returns 0 if the packet should be delivered, an error code otherwise