@@ -191,7 +191,14 @@ static bool spawnPasta(nsjconf_t* nsjconf, int pid) {
191191 argv.push_back (" -f" );
192192 argv.push_back (" -q" );
193193
194- if (!nsjconf->user_net .ip .empty ()) {
194+ if (!nsjconf->user_net .inbound ) {
195+ argv.push_back (" -t" );
196+ argv.push_back (" none" );
197+ }
198+
199+ if (nsjconf->user_net .ip .empty ()) {
200+ argv.push_back (" -6" );
201+ } else {
195202 argv.push_back (" -a" );
196203 argv.push_back (nsjconf->user_net .ip .c_str ());
197204 if (!nsjconf->user_net .mask .empty ()) {
@@ -204,7 +211,9 @@ static bool spawnPasta(nsjconf_t* nsjconf, int pid) {
204211 }
205212 }
206213
207- if (!nsjconf->user_net .ip6 .empty ()) {
214+ if (nsjconf->user_net .ip6 .empty ()) {
215+ argv.push_back (" -4" );
216+ } else {
208217 argv.push_back (" -a" );
209218 argv.push_back (nsjconf->user_net .ip6 .c_str ());
210219
@@ -214,10 +223,6 @@ static bool spawnPasta(nsjconf_t* nsjconf, int pid) {
214223 }
215224 }
216225
217- if (nsjconf->user_net .ip6 .empty ()) {
218- argv.push_back (" -4" );
219- }
220-
221226 if (!nsjconf->user_net .nsiface .empty ()) {
222227 argv.push_back (" -I" );
223228 argv.push_back (nsjconf->user_net .nsiface .c_str ());
@@ -253,7 +258,7 @@ static bool spawnPasta(nsjconf_t* nsjconf, int pid) {
253258}
254259
255260bool initNsFromParent (nsjconf_t * nsjconf, int pid) {
256- if (nsjconf->use_pasta ) {
261+ if (nsjconf->user_net . use_pasta ) {
257262 if (!nsjconf->clone_newnet ) {
258263 LOG_E (" Support for User-Mode Networking requested (pasta) but CLONE_NEWNET "
259264 " is not enabled" );
0 commit comments