Skip to content

Fix DefaultChannelId MAC address parsing bug#6147

Closed
Scottmitch wants to merge 1 commit into
netty:4.1from
Scottmitch:mac_parse
Closed

Fix DefaultChannelId MAC address parsing bug#6147
Scottmitch wants to merge 1 commit into
netty:4.1from
Scottmitch:mac_parse

Conversation

@Scottmitch
Copy link
Copy Markdown
Member

Motivation:
DefaultChannelId provides a regular expression which validates if a user provided MAC address is valid. This regular expression may allow invalid MAC addresses and also not allow valid MAC addresses.

Modifications:

  • Introduce a MacAddressUtil#parseMac method which can parse and validate the MAC address at the same time. The regular expression check before hand is additional overhead if we have to parse the MAC address.

Result:
Fixes #6132.

@Scottmitch Scottmitch self-assigned this Dec 20, 2016
@Scottmitch Scottmitch added this to the 4.0.43.Final milestone Dec 20, 2016
@Scottmitch
Copy link
Copy Markdown
Member Author

@jo-kin - Please verify this fixes the issue.

@normanmaurer
Copy link
Copy Markdown
Member

@Scottmitch there must be something wrong... Please check:

io.netty.channel.ChannelException: Unable to create Channel from class class io.netty.channel.local.LocalServerChannel
    at io.netty.bootstrap.BootstrapTest.testAsyncResolutionFailure(BootstrapTest.java:263)
Caused by: java.lang.NoClassDefFoundError: Could not initialize class io.netty.channel.DefaultChannelId
    at io.netty.bootstrap.BootstrapTest.testAsyncResolutionFailure(BootstrapTest.java:263)

@Scottmitch Scottmitch force-pushed the mac_parse branch 2 times, most recently from 382bcc3 to 7adfaaa Compare December 20, 2016 21:17
@Scottmitch
Copy link
Copy Markdown
Member Author

@normanmaurer - issue should be fixed now.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Scottmitch just remove the @return as it is the same as what is stated already ?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sure

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Scottmitch :-] looks nice and friendly ;)

@normanmaurer
Copy link
Copy Markdown
Member

@Scottmitch just one comment.. otherwise LGTM

@normanmaurer
Copy link
Copy Markdown
Member

@Scottmitch ship it

Motivation:
DefaultChannelId provides a regular expression which validates if a user provided MAC address is valid. This regular expression may allow invalid MAC addresses and also not allow valid MAC addresses.

Modifications:
- Introduce a MacAddressUtil#parseMac method which can parse and validate the MAC address at the same time. The regular expression check before hand is additional overhead if we have to parse the MAC address.

Result:
Fixes netty#6132.
@Scottmitch
Copy link
Copy Markdown
Member Author

4.1 (3d11334)

@Scottmitch Scottmitch closed this Dec 21, 2016
@Scottmitch Scottmitch deleted the mac_parse branch December 21, 2016 01:08
@Scottmitch Scottmitch modified the milestones: 4.1.7.Final, 4.0.43.Final Dec 21, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants