Reject removed legacy inbound fields instead of silently ignoring
This commit is contained in:
@@ -44,6 +44,12 @@ func (h *Inbound) UnmarshalJSONContext(ctx context.Context, content []byte) erro
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
if listenWrapper, isListen := options.(ListenOptionsWrapper); isListen {
|
||||||
|
//nolint:staticcheck
|
||||||
|
if listenWrapper.TakeListenOptions().InboundOptions != (InboundOptions{}) {
|
||||||
|
return E.New("legacy inbound fields are deprecated in sing-box 1.11.0 and removed in sing-box 1.13.0, checkout migration: https://sing-box.sagernet.org/migration/#migrate-legacy-inbound-fields-to-rule-actions")
|
||||||
|
}
|
||||||
|
}
|
||||||
h.Options = options
|
h.Options = options
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -67,6 +67,10 @@ func NewInbound(ctx context.Context, router adapter.Router, logger log.ContextLo
|
|||||||
if options.GSO {
|
if options.GSO {
|
||||||
return nil, E.New("GSO option in tun is deprecated in sing-box 1.11.0 and removed in sing-box 1.12.0")
|
return nil, E.New("GSO option in tun is deprecated in sing-box 1.11.0 and removed in sing-box 1.12.0")
|
||||||
}
|
}
|
||||||
|
//nolint:staticcheck
|
||||||
|
if options.InboundOptions != (option.InboundOptions{}) {
|
||||||
|
return nil, E.New("legacy inbound fields are deprecated in sing-box 1.11.0 and removed in sing-box 1.13.0, checkout migration: https://sing-box.sagernet.org/migration/#migrate-legacy-inbound-fields-to-rule-actions")
|
||||||
|
}
|
||||||
|
|
||||||
address := options.Address
|
address := options.Address
|
||||||
inet4Address := common.Filter(address, func(it netip.Prefix) bool {
|
inet4Address := common.Filter(address, func(it netip.Prefix) bool {
|
||||||
|
|||||||
Reference in New Issue
Block a user