[Top][All Lists]

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

wget2 | Add option --bind-interface (!462)

From: Suhas K S
Subject: wget2 | Add option --bind-interface (!462)
Date: Mon, 09 Dec 2019 18:53:08 +0000

Suhas K S created a merge request: 

Project:Branches: suhasks123/wget2:addBindInterface to gnuwget/wget2:master
Author:    Suhas K S

### Design:
`--bind-interface` is a download option which involves binding the socket of 
the TCP connection to a particular network interface on the local machine.

This is implemented in the function `set_socket_options()` in libwget/net.c 
which is called by `wget_tcp_connect()` in the same file. The interface to bind 
to is stored in `config.bind_interface` in src/wget_options.h. This is made 
accessible to `wget_tcp_connect()` by passing it to a function 
`wget_tcp_bind_interface()` which sets the value of the variable 
`bind_interface` of the struct `global_tcp` to the parameter passed to it. This 
way, all the functions of net.c can access `bind_interface`, including 
`wget_tcp_connect()` and `set_socket_options()` which use it to bind the 
created socket to it.

One particular thing to note is that wget2 has to be run with elevated 
privileges for the option to work. Also, as of now, there are no tests for this 
option in the test-suite.

### Approver's checklist:

* [ ] The author has submitted the FSF Copyright Assignment and is listed in 
* [ ] There is a test suite reasonably covering new functionality or 
* [ ] Function naming, parameters, return values, types, etc., are consistent 
with existing code
* [ ] This feature/change has adequate documentation added (if appropriate)
* [ ] No obvious mistakes / misspelling in the code

Reply to this email directly or view it on GitLab: 
You're receiving this email because of your account on gitlab.com.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]