Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pcpserver does not handle all-zeroes IPv4 external address correctly #69

Closed
ppuryear opened this issue Apr 21, 2014 · 2 comments
Closed

Comments

@ppuryear
Copy link

I recently updated my home router to a firmware that uses miniupnpd 1.8.20140401. I immediately began seeing messages like this in the system log:

Apr 20 03:32:10 miniupnpd[474]: PCP: External IP in request didn't match interface IP

After recompiling miniupnpd with -DDEBUG, I got this information:

Apr 20 03:32:10 miniupnpd[474]: PCP request received from 192.168.1.224:5353 60bytes
Apr 20 03:32:10 miniupnpd[474]: PCP MAP: v2 Opcode specific information.
Apr 20 03:32:10 miniupnpd[474]: MAP nonce:      70ec7ba6133c3dda59e45bc2
Apr 20 03:32:10 miniupnpd[474]: MAP protocol:   17
Apr 20 03:32:10 miniupnpd[474]: MAP int port:   16402
Apr 20 03:32:10 miniupnpd[474]: MAP ext port:   55709
Apr 20 03:32:10 miniupnpd[474]: MAP Ext IP:     ::ffff:0.0.0.0
Apr 20 03:32:10 miniupnpd[474]: PCP: External IP in request didn't match interface IP 
Apr 20 03:32:10 miniupnpd[474]: Interface IP ::ffff:xx.xxx.xx.xx
Apr 20 03:32:10 miniupnpd[474]: IP in the PCP request ::ffff:0.0.0.0 

(where the x's are my public IPv4 address). So miniupnpd is complaining about a MAP request using the all-zeroes IPv4 suggested external address ::ffff:0.0.0.0 (see http://tools.ietf.org/html/rfc6887#section-5).

Looking at the code, it looks like CheckExternalAddress uses IN6_IS_ADDR_UNSPECIFIED to check for all-zeroes addresses. However, that macro only works for actual IPv6 addresses, not IPv6-mapped IPv4 addresses (it essentially just checks that all 16 bytes of the address are zero).

@miniupnp
Copy link
Owner

thanks for reporting the problem.
Do you know which software is requesting the maping using PCP ?

@ppuryear
Copy link
Author

It appears to be OS X Messages and iOS iMessage/Facetime. Cold-starting Messages on my Macbook reliably generates the request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants