Re: Making the in-kernel DNS resolver handle server lists

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



David Howells <dhowells@xxxxxxxxxx> writes:
> The payload handed to the kernel currently looks like something assembled from
> the data obtained from a bunch of SRV records that have been further looked up
> to A or AAAA.

I was wondering recently if the current kernel API lets you to access
all A/AAAA records in case a same domain uses multiple ones. It seems
not, is this correct?

> In the kernel it might get parsed to something like:
>
> 	struct address {
> 		union {
> 			struct sockaddr_in	sin;
> 			struct sockaddr_in6	sin6;
> 		};
> 	};

You probably want struct sockaddr_storage here.


>
> 	struct server {
> 		unsigned short		port;
> 		unsigned short		pref;		// From SRV
> 		unsigned short		weight;		// From SRV
> 		unsigned char		ipproto;	// IPPROTO_*
> 		unsigned int		nr_addrs;	// May be 0
> 		struct address		*addrs;
> 	};
>
> 	struct server_list {
> 		unsigned int		nr_servers;
> 		struct server		servers[];
> 	};
>
> Is this something that NFS or CIFS (or anything else for that matter) could
> find useful?

That sounds useful indeed. I'm currently thinking about a failover
mechanism for DFS (symbolic links across servers in cifs). The protocol
supports multiple possible targets for the link in case one is down. The
targets are usually using hostnames so with your change we could have a
second layer of failover at the DNS level.

> I also have this loading information from a configuration file as a
> backup/override of the DNS.  Could that also be useful to NFS/CIFS?

Cheers,
-- 
Aurélien Aptel / SUSE Labs Samba Team
GPG: 1839 CB5F 9F5B FB9B AA97  8C99 03C8 A49B 521B D5D3
SUSE Linux GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
GF: Felix Imendörffer, Jane Smithard, Graham Norton, HRB 21284 (AG Nürnberg)



[Index of Archives]     [Linux Filesystem Development]     [Linux USB Development]     [Linux Media Development]     [Video for Linux]     [Linux NILFS]     [Linux Audio Users]     [Yosemite Info]     [Linux SCSI]

  Powered by Linux