LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking > Linux - Wireless Networking
User Name
Password
Linux - Wireless Networking This forum is for the discussion of wireless networking in Linux.

Notices


Reply
  Search this Thread
Old 01-02-2015, 05:56 PM   #1
crackpipe
Member
 
Registered: Nov 2005
Location: Berkeley, CA
Distribution: Slackware, Arch, Zenwalk (pre-2012)
Posts: 41

Rep: Reputation: 15
Appears sane is only IPV6 for network connections. Workarounds?


I was recently at a buddy who has an old Brother MFC8840D on his WiFi LAN. I printed via CUPS but also wanted to try to scan -- I've heard it can be difficult on a network. It was.

In root or as user, I was unable to bind a socket. There's probably a workaround in /etc/hosts settings or some such, but this appears to be a situation where it won't drop back to IPV4 when it tries to bind the socket. Here is the relevant spot it fails as root in "strace scanimage -L"
Code:
socket(PF_INET6, SOCK_DGRAM, IPPROTO_IP) = 132
setsockopt(132, SOL_SOCKET, SO_BROADCAST, [1], 4) = 0
setsockopt(132, SOL_IPV6, IPV6_V6ONLY, [1], 4) = 0
bind(132, {sa_family=AF_INET6, sin6_port=htons(8612), inet_pton(AF_INET6, "fe80::b277:2173:31a6:e71", &sin6_addr), sin6_flowinfo=0, sin6_scope_id=if_nametoindex("enp4s0")}, 28) = -1 EADDRNOTAVAIL (Cannot assign requested address)
fstat(2, {st_mode=S_IFIFO|0600, st_size=0, ...}) = 0
write(2, "[bjnp] ", 7[bjnp] )                  = 7
write(2, "create_broadcast_socket: bind so"..., 95create_broadcast_socket: bind socket to local address failed - Cannot assign requested address
) = 95
close(132)
Do I need to put something like "ffff" as a prefix in my Hosts file; some other? Thanks.
 
Old 01-03-2015, 05:09 AM   #2
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
Quote:
Originally Posted by crackpipe View Post
(..) this appears to be a situation where it won't drop back to IPV4 when it tries to bind the socket.
That appears to be the case when getaddrinfo() gets a usable IPv6 result back. (As in why would it ignore a perfectly good response?) I guess you'll have to find out how to make IPv4 stack address resolution requests take precedence over IPv6 ones:
0) see if you have "options inet6" in/etc/resolv.conf,
1) see if you have "multi on" in /etc/host.conf,
2) see if you have a "/etc/gai.conf" file. If you have one comment everything out, make these the last two lines:
Code:
# For sites which prefer IPv4 connections:
precedence ::ffff:0:0/96 100
Then strace lookups again and check for difference in behaviour.
 
1 members found this post helpful.
Old 01-31-2015, 02:40 PM   #3
crackpipe
Member
 
Registered: Nov 2005
Location: Berkeley, CA
Distribution: Slackware, Arch, Zenwalk (pre-2012)
Posts: 41

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by unSpawn View Post
That appears to be the case when getaddrinfo() gets a usable IPv6 result back. (As in why would it ignore a perfectly good response?) I guess you'll have to find out how to make IPv4 stack address resolution requests take precedence over IPv6 ones:
0) see if you have "options inet6" in/etc/resolv.conf,
1) see if you have "multi on" in /etc/host.conf,
2) see if you have a "/etc/gai.conf" file. If you have one comment everything out, make these the last two lines:
Code:
# For sites which prefer IPv4 connections:
precedence ::ffff:0:0/96 100
Then strace lookups again and check for difference in behaviour.
Thank you very much. The issue was apparently a Brother requirement for a scanning backend when on a network (as opposed to USB scanning). Once I installed the Brother backend for network scanning, the IPV6 situation went away. However the notes you made are extremely helpful and logical for anyone looking to solve an IPV4/6 problem. I used to run into those before curl was updated, for example.

In this problem, I should have known that, just because the MFC-8840D is a printer has zero to do with its scanning firmware. In other words, CUPS has no bearing on the scanning and provides no hidden support in the process. Indeed, once the backend was installed, scanning was accomplished over the network entirely without the CUPS daemon even being enabled. So it's a simple matter of getting the Brother network scanning backend.

I'd like to somehow note this as "solved" but not sure how to edit the title here. Thanks again for the great feedback.
 
  


Reply

Tags
/etc/gai.conf, ipv6, prefer ipv4, sane, wlan



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Root server & 2 VMs: best setup for IPv4 and IPv6 connections? Pearlseattle Linux - Networking 0 10-14-2012 01:24 PM
xinetd appears broken. Connections send random or butchered data hda7 Linux - Software 1 05-31-2011 03:27 PM
[SOLVED] Shell script network data collection anomaly- need help for workarounds/changes kcleveland Programming 4 06-07-2010 10:35 AM
Blacklist ipv6 to speed up internet connections. Mol_Bolom Linux - Networking 5 10-05-2009 07:26 PM
IPv6 limit connections per user Tux-Slack Linux - Networking 1 03-31-2007 11:14 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking > Linux - Wireless Networking

All times are GMT -5. The time now is 12:09 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration