2009-07-20 16:39:24

by Rafael Almeida

[permalink] [raw]
Subject: using ioctl to change the interface's IP

Hello,

I was studying ioctl recently and I found out that, in order to change
the IP of a certain interface, you have to create a dummy socket with
socket(2) and use the returned file descriptor in the ioctl call. That
seems strange to me because the IP is not changed only for that
particular descriptor, but globally. Why wasn't a new system call
created for handling situations such as that?

[]'s
Rafael


2009-07-20 16:48:36

by Alan

[permalink] [raw]
Subject: Re: using ioctl to change the interface's IP

On Mon, 20 Jul 2009 13:39:21 -0300
Rafael Almeida <[email protected]> wrote:

> Hello,
>
> I was studying ioctl recently and I found out that, in order to change
> the IP of a certain interface, you have to create a dummy socket with
> socket(2) and use the returned file descriptor in the ioctl call. That
> seems strange to me because the IP is not changed only for that
> particular descriptor, but globally. Why wasn't a new system call
> created for handling situations such as that?

You would have to ask the people who invented the Unix interface in
question about thirty years ago