@@ -495,12 +495,12 @@ func (p *Protocol) addChain(attrs map[uint16]nlmsg.BytesView, tab *nftables.Tabl
495495// chainParseHook parses the hook attributes and returns a complete
496496// BaseChainInfo.
497497func (p * Protocol ) chainParseHook (chain * nftables.Chain , family stack.AddressFamily , hdata nlmsg.AttrsView ) (* nftables.BaseChainInfo , * syserr.AnnotatedError ) {
498- hookAttrs , ok := hdata .Parse ()
499- var hookInfo nftables.HookInfo
498+ hookAttrs , ok := nftables .NfParse (hdata )
500499 if ! ok {
501500 return nil , syserr .NewAnnotatedError (syserr .ErrInvalidArgument , fmt .Sprintf ("Nftables: Failed to parse hook attributes" ))
502501 }
503502
503+ var hookInfo nftables.HookInfo
504504 if chain != nil {
505505 // TODO: b/434243967 - Support updating existing chains.
506506 return nil , syserr .NewAnnotatedError (syserr .ErrNotSupported , fmt .Sprintf ("Nftables: Updating hook attributes are not supported for existing chains" ))
@@ -935,7 +935,7 @@ func parseNestedExprs(nestedAttrBytes nlmsg.AttrsView) ([]nftables.ExprInfo, *sy
935935 }
936936 numExprs ++
937937
938- exprAttrs , ok := nlmsg .AttrsView (value ). Parse ( )
938+ exprAttrs , ok := nftables . NfParse ( nlmsg .AttrsView (value ))
939939 if ! ok {
940940 return nil , syserr .NewAnnotatedError (syserr .ErrInvalidArgument , "Nftables: Failed to parse attributes for expression" )
941941 }
@@ -1139,7 +1139,7 @@ func (p *Protocol) ProcessMessage(ctx context.Context, s *netlink.Socket, msg *n
11391139 return syserr .ErrInvalidArgument
11401140 }
11411141
1142- attrs , ok := atr . Parse ( )
1142+ attrs , ok := nftables . NfParse ( atr )
11431143 if ! ok {
11441144 log .Debugf ("Failed to parse message attributes" )
11451145 return syserr .ErrInvalidArgument
@@ -1206,7 +1206,7 @@ func (p *Protocol) receiveBatchMessage(ctx context.Context, s *netlink.Socket, m
12061206 return syserr .NewAnnotatedError (syserr .ErrInvalidArgument , "Nftables: Failed to get message data" )
12071207 }
12081208
1209- attrs , ok := atr . Parse ( )
1209+ attrs , ok := nftables . NfParse ( atr )
12101210 if ! ok {
12111211 return syserr .NewAnnotatedError (syserr .ErrInvalidArgument , "Failed to parse message attributes for batch message" )
12121212 }
@@ -1322,7 +1322,7 @@ func (p *Protocol) processBatchMessage(ctx context.Context, s *netlink.Socket, b
13221322 continue
13231323 }
13241324
1325- attrs , ok := atr . Parse ( )
1325+ attrs , ok := nftables . NfParse ( atr )
13261326 if ! ok {
13271327 netlink .DumpErrorMessage (hdr , ms , syserr .ErrInvalidArgument )
13281328 continue
0 commit comments